home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / MATHS / ARCAUT / Automatons / Brown < prev    next >
Text File  |  1991-07-27  |  1KB  |  38 lines

  1. AUTOMATON*
  2.  
  3.   Brown'n_Motion
  4.  
  5.   'Brownian Motion' makes use of the Margolus neighbourhood RNDB function.
  6.   This returns a random value for each 2x2 block of cells in the CA universe.
  7.   In this automaton the number is used to select a way of jumbling up the
  8.   cells in each block; thus the total number of cells of each state is
  9.   preserved, & each cell appears to take a random walk in the grid. It starts
  10.   from four ordered, differently coloured circles on a black background.
  11.   Notice how the various colours diffuse into each other, eventually becoming
  12.   uniformly distributed. Compare with 'GeneticDrift'.
  13.  
  14. INITIALISATION*
  15.  
  16.   10DEF PROCdo
  17.   20*SetEval wrap on
  18.   30*SetEval neig margolus
  19.   40*SetEval rndb -1
  20.   50ENDPROC
  21.  
  22. SCREEN*
  23.  
  24.   10DEF PROCdo
  25.   20DIM buf% 256:SYS "OS_ReadVarVal","sux",buf%,256
  26.   30a%=!buf%:r%=.8*a%
  27.   40GCOL 63:CIRCLE FILL a%,a%,r%
  28.   50GCOL 48:CIRCLE FILL -a%,a%,r%
  29.   60GCOL 12:CIRCLE FILL a%,-a%,r%
  30.   70GCOL 3:CIRCLE FILL -a%,-a%,r%
  31.   80ENDPROC
  32.  
  33. CODE*
  34.  
  35. ( READ_NEIG
  36.   2RNDB IF (CW ==) CCW == )
  37.  
  38. END*